package com.cyj.dream.core.config.mybatisplus;

import com.cyj.dream.core.resolver.SqlFilterArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @Description: mybatis-plus统一配置
 * @BelongsProject: DreamChardonnay
 * @BelongsPackage: com.cyj.dream.core.config.mybatisplus
 * @Author: ChenYongJia
 * @CreateTime: 2021-09-27 08:51
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@Configuration(proxyBeanMethods = false)
public class MybatisAutoConfiguration implements WebMvcConfigurer {

    /**
     * SQL 过滤器避免SQL 注入
     * @param argumentResolvers
     */
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new SqlFilterArgumentResolver());
    }

}
